package com.shanyu.wechat.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shanyu.wechat.entity.JianDaoYunEntity;
import com.shanyu.wechat.entity.ProjectEntity;
import com.shanyu.wechat.entity.Result;
import com.shanyu.wechat.service.JianDaoYunService;
import com.shanyu.wechat.service.ProjectEntityService;
import com.shanyu.wechat.util.ParameterUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.Map;

import static reactor.core.publisher.Mono.just;

/**
 * author: wangsixian
 */
@RestController
@RequestMapping("/jiandaoyun")
@RequiredArgsConstructor
public class JianDaoYunController {

    private final JianDaoYunService service;

    @RequestMapping("/list")
    public Mono<Result<IPage<JianDaoYunEntity>>> queryPageList(@RequestBody Map<String, Object> params) {
        IPage<JianDaoYunEntity> pageList = service.getPage(ParameterUtils.getPage(params), params);
        return just(Result.OK(pageList));
    }
}
